package edu.sctu;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @Author:Mrzhang
 * @Description:
 * @Date:2018.05.20 15:53
 **/
public class Main {
    public static void main(String[] args) {
        List<Double> list = new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int num = sc.nextInt();
            for (int i = 0; i < num; i++) {
                double d = sc.nextDouble();
                list.add(d);
            }

            for (int i = 0; i < list.size(); i++) {
                String s = String.valueOf(list.get(i));
                int location = s.indexOf(".");
                int l = list.size() - location;
                int a = Integer.parseInt(s.substring(s.indexOf(".") + l));//获取小数点后的第一位
                if (a >= 5){
                    a = Integer.parseInt(s.substring(0, s.indexOf("."))) + 1;//整数部分+1
                } else {
                    a = Integer.parseInt(s.substring(0, s.indexOf(".")));
                }
                System.out.println(a);
            }
        }

    }

}
